<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
    <meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
    <title>sort4</title>
    <style type="text/css">
        * { margin:0; padding:0; }
        div.centent {
            float:left;
            text-align: center;
            margin: 10px;
        }
        span {
            display:block;
            margin:2px 2px;
            padding:4px 10px;
            background:#898989;
            cursor:pointer;
            font-size:12px;
            color:white;
        }
    </style>
    <!--   引入jQuery -->
    <script src="jquery/jquery-3.3.1.min.js" type="text/javascript"></script>
    <script type="text/javascript">
        if(spec=="spec1"){
            $("#spec2 option").show();
            var values = $("#spec1").val();
            $("#spec2 option[value="+values+"]").hide();
        }
        if(spec=="spec2"){
            $("#spec1 option").show();
            var values = $("#spec2").val();
            $("#spec1 option[value="+values+"]").hide();
        }
    </script>

</head>
<body>
<select name="spec1" id="spec1" onchange="specSelect(this,'spec1')">
    <option value="0" >==选择规格1==</option>
    <option value="1">去</option>
    <option value="2">来</option>
    <option value="3">走</option>
</select>

<select name="spec2" id="spec2" onchange="specSelect(this,'spec1')">
    <option value="0" >==选择规格2==</option>
    <option value="1">去</option>
    <option value="2">来</option>
    <option value="3">走</option>
</select>


</body>
</html>